﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WURFL;
using WURFL.Config;
using WURFL.Request;

namespace wurfltest
{
    public partial class _Default : System.Web.UI.Page
    {
        public const String WurflManagerCacheKey = "__WurflManager";
        public const String WurflDataFilePath = "~/App_Data/wurfl-latest.zip";
        public const String WurflPatchFilePath = "~/App_Data/web_browsers_patch.xml";

        protected void Page_Load(object sender, EventArgs e)
        {
            var wurflDataFile = HttpContext.Current.Server.MapPath(WurflDataFilePath);
            var wurflPatchFile = HttpContext.Current.Server.MapPath(WurflPatchFilePath);

            var configurer = new InMemoryConfigurer()
                .MainFile(wurflDataFile)
                .PatchFile(wurflPatchFile);
            var manager = WURFLManagerBuilder.Build(configurer);
           string istablet= manager.GetDeviceForRequest(new WURFLRequest(HttpContext.Current.Request.UserAgent), MatchMode.Accuracy).
                GetCapability("is_tablet");
        }
    }
}